package structure;

public class branch03 {
    public static void main(String[] args) {
//        while循环
        int i = 0;                              //初始化语句
        while(i < 5){                           //while（循环条件）
            System.out.println("Hello World");  //被重复执行的代码
            i++;                                //迭代语句
        }


        //定义纸张的厚度和珠穆朗玛峰的高度
        double paperThickness = 0.1;
        double peakHeight = 8848860;
        //记住循环的次数
        int count = 0;
        while(paperThickness < peakHeight){
            paperThickness = paperThickness * 2;
            count++;
        }
        System.out.println("需要折叠的次数：" + count);  //需要折叠的次数
        System.out.println("最终纸张的厚度：" + paperThickness);  //纸张的最终厚度
    }
}
